<?php
namespace app\api\validate;

class TaskValidate extends \think\Validate
{

    const SCENE_INFO = 'info'; //获取详情
    const SCENE_RECEIVE = 'receive'; //领取任务
    const SCENE_REMOVE = 'remove'; //删除权限
    const SCENE_MODIFY = 'modify'; //修改权限



    protected $rule = [
        'id' => 'require|number',
        'name' => 'require|max:32',
        'desc' => 'require|max:255',
    ];


    protected $message  = [
        'id.require' => 'ID必须填写',
        'id.number' => 'ID必须为整数',
        'name.require' => '请填写职位名称',
        'name.max' => '职位名称不能超过32个字符',
        'desc.require' => '请填写职位描述',
        'desc.max' => '职位描述不能超过255个字符',

    ];

    protected $scene  = [
       self::SCENE_INFO => ['id'],
       self::SCENE_RECEIVE => ['id'],
       self::SCENE_MODIFY => ['name', 'desc'],
       self::SCENE_REMOVE => ['id'],
    ];

}